/*
 * @Author:商俊帅
 * @Date: 2021年5月9日08:57:58
 */
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)


//路由懒加载式引入路由

//1.定义路由组件
const Login=()=>import("../views/Login.vue")


//2.定义路由,每个路由(path)映射一个组件(component)
const routes = [
  {
    path:"/",
    redirect:"/login"
  },
  {
    path:"/login",
    component:Login
  }
]

//3.创建router实例
const router = new Router({
  //缩写,相当于routes:routes
  routes
});
//4.最后在main.js全局挂载
export default router;

